package com.dkf.springcloud.config;


import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.logback.AmqpAppender;
import org.springframework.stereotype.Component;

import java.util.UUID;

@Component
public class MyEnhancedAppender extends AmqpAppender {
    @Override
    public Message postProcessMessageBeforeSend(Message message, Event event) {
        message.getMessageProperties().setMessageId(UUID.randomUUID().toString());
        message.getMessageProperties().setHeader("foo", "bar");

        return message;
    }
}
